package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.UserCustomerRelationMapper;
import com.ruoyi.system.domain.UserCustomerRelation;
import com.ruoyi.system.service.IUserCustomerRelationService;

/**
 * 用户客户关系Service业务层处理
 * 
 * @author ruoyi
 */
@Service
public class UserCustomerRelationServiceImpl implements IUserCustomerRelationService 
{
    @Autowired
    private UserCustomerRelationMapper userCustomerRelationMapper;

    /**
     * 查询用户负责的客户关系列表
     * 
     * @param userCustomerRelation 用户客户关系
     * @return 用户客户关系
     */
    @Override
    public List<UserCustomerRelation> selectUserCustomerRelationList(UserCustomerRelation userCustomerRelation)
    {
        return userCustomerRelationMapper.selectUserCustomerRelationList(userCustomerRelation);
    }

    /**
     * 查询客户的负责人ID
     * 
     * @param customerId 客户ID
     * @return 用户ID
     */
    @Override
    public Long selectUserByCustomerId(Long customerId)
    {
        return userCustomerRelationMapper.selectUserByCustomerId(customerId);
    }

    /**
     * 新增用户客户关系
     * 
     * @param userCustomerRelation 用户客户关系
     * @return 结果
     */
    @Override
    public int insertUserCustomerRelation(UserCustomerRelation userCustomerRelation)
    {
        return userCustomerRelationMapper.insertUserCustomerRelation(userCustomerRelation);
    }

    /**
     * 修改客户负责人
     * 
     * @param userCustomerRelation 用户客户关系
     * @return 结果
     */
    @Override
    public int updateUserCustomerRelation(UserCustomerRelation userCustomerRelation)
    {
        return userCustomerRelationMapper.updateUserCustomerRelation(userCustomerRelation);
    }

    /**
     * 删除用户客户关系信息
     * 
     * @param customerId 客户ID
     * @return 结果
     */
    @Override
    public int deleteUserCustomerRelation(Long customerId)
    {
        return userCustomerRelationMapper.deleteUserCustomerRelation(customerId);
    }

    /**
     * 批量删除用户客户关系信息
     * 
     * @param relationIds 需要删除的用户客户关系ID
     * @return 结果
     */
    @Override
    public int deleteUserCustomerRelationByIds(Long[] relationIds)
    {
        return userCustomerRelationMapper.deleteUserCustomerRelationByIds(relationIds);
    }
} 